package xyz.hrzhen;


import org.springframework.stereotype.Component;
import org.ssssssss.magicapi.modules.db.BoundSql;
import org.ssssssss.magicapi.modules.db.dialect.Dialect;



// 补充lealone的语法兼容
@Component
public class lealoneDialect  implements Dialect {

    @Override
    public boolean match(String jdbcUrl) {
        return jdbcUrl.contains(":lealone:");
    }

    @Override
    public String getPageSql(String sql, BoundSql boundSql, long offset, long limit) {
        boundSql.addParameter(offset);
        boundSql.addParameter(limit);
        return sql + " limit ?,?";
    }

}